<template>
  <c-back-wrap :loading="loading" go-page="意向客户管理" current-page="详情">
    <QupList :column="3" sep="：" default-value="" label-position="right" label-width="130">
      <QupListItem label="意向客户电话" :value="detail.customerPhone" />
      <QupListItem label="意向客户姓名" :value="detail.customerName" />
      <QupListItem label="身份证号" :value="detail.customerIdcard" />
      <QupListItem label="是否有店面" :value="detail.isHaveShop" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="店面总面积" :value="`${detail.shopArea || 0}㎡`" />
      <QupListItem label="意向经营业务">
        <c-mdm-view :value="detail.intendedBusiness" :label="detail.intendedBusinessName" doc-code="QY037" />
      </QupListItem>
      <QupListItem label="意向加盟城市" :value="detail.intendedCity" />
      <QupListItem label="客户来源" :value="detail.customerSource" dict-type-code="CTM_TOBE_CUSTOMER_DATA_FROM" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="所属办事处" :value="detail.agencyName" />
      <QupListItem label="性别">
        <c-mdm-view :value="detail.customerSex!==undefined?detail.customerSex.toString():''" :label="detail.customerSexName" doc-code="QY020" />
      </QupListItem>
      <QupListItem label="年龄" :value="detail.customerAge" />
      <QupListItem label="意向等级">
        <Tip>
          <div slot="tip">
            A类：确定与全友合作意向，有合作实力，有合适口岸，可快速签约；<br>
            B类：明确与全友合作意向，但可能资金不足或口岸不达标；<br>
            C类：有明确投资意向，对全友或其他竞品品牌；
          </div>
          <c-dict-range-view :value="detail.intendedLevel" dict-type-code="CTM_INTENTION_LEVEL" domain-code="marketing" app-code="slm" />
        </Tip>
      </QupListItem>
      <QupListItem label="意向客户分类" :value="detail.customerType" dict-type-code="CTM_TOBE_CUSTOMER_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="招商经理" :value="detail.managerName" />
      <QupListItem label="现经营品牌/行业资历" :value="detail.industryQualification" :span="24" />
      <QupListItem label="特别备注" :value="detail.specialRemarks" :span="24" />
      <QupListItem label="来源渠道" :value="detail.channel" dict-type-code="CTM_POTENTIAL_CUSTOMER_SOURCE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="跟进进度" :value="detail.followUpStage" dict-type-code="CTM_INTEND_CUS_FOLLOW_UP_PROGRESS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="创建人" :value="detail.createBy" />
      <QupListItem label="终止原因" :value="detail.terminationCause" :span="24" />
      <QupListItem label="创建时间" :value="detail.createTime" />
      <QupListItem label="修改人" :value="detail.lastUpdateBy" />
      <QupListItem label="修改时间" :value="detail.lastUpdateTime" />
    </QupList>
    <div class="btn-center">
      <c-button type="primary" @click="handleGoBack">返回</c-button>
    </div>
  </c-back-wrap>
</template>
<script>
import { potentialCustomerDetail } from '@/api/channelTask2/potentialCustomer'
import Tip from '@/components/Tip'
import CDictRangeView from '@/components/CDictRangeView'
export default {
  name: 'Detail',
  components: {
    Tip,
    CDictRangeView
  },
  props: {
    id: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      detail: {},
      loading: false
    }
  },
  created() {
    this.getDetailData()
  },
  methods: {
    getDetailData() {
      this.loading = true
      return potentialCustomerDetail(this.id).then(res => {
        this.detail = res.data
      }).finally(() => {
        this.loading = false
      })
    },
    handleGoBack() {
      this.$pageStack.pop()
    }
  }
}
</script>
